package org.kealinghornets.jchuah.buttons;

import android.content.Intent;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Toast;


public class leaval3 extends MainActivity {

        public void checkvictory() {
            View i1 = findViewById(R.id.star1);
            View i2 = findViewById(R.id.star2);
            View i3 = findViewById(R.id.star3);
            View i4 = findViewById(R.id.star4);
            if (i1.getVisibility() == View.VISIBLE && i2.getVisibility() == View.VISIBLE && i3.getVisibility() == View.VISIBLE && (i4.getVisibility() == View.VISIBLE))
                Toast.makeText(this, "YOU WIN!!!!!!!!!! CONGRATS!!!!!!!!!", Toast.LENGTH_LONG).show();
                startActivity(new Intent(this, thankyou.class));
        }
    public void onleftthingPush (View view) {
        toggleVisibility(R. id. i2);
        toggleVisibility(R.id.i3);
        checkvictory();
    }
    public void onmiddlethingPush (View view) {
        toggleVisibility(R. id. i3);
        toggleVisibility(R. id. i4);
        checkvictory();
    }
   public void onrightthingPush (View view) {
       toggleVisibility(R. id. i1);
       toggleVisibility(R. id. i3);
       checkvictory();
   }
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_leaval3);
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_leaval3, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }
}
